package com.woniuxy.service.impl;


import com.github.pagehelper.Page;
import com.github.pagehelper.PageHelper;
import com.woniuxy.dao.LoginSysLogMapper;
import com.woniuxy.pojo.LoginSysLog;
import com.woniuxy.service.LoginSysLogService;
import com.woniuxy.util.DataGridView;
import com.woniuxy.util.LoginSysLogVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class LoginSysLogServiceImpl implements LoginSysLogService {

    @Autowired
    private LoginSysLogMapper sysLogMapper;
    @Override
    public void saveLog(LoginSysLog loginsysLog) {
        this.sysLogMapper.saveLog(loginsysLog);
    }

    @Override
    public DataGridView findAllsysLogs(LoginSysLogVo loginsysLog) {
        Page<Object> page= PageHelper.startPage(loginsysLog.getPage(),loginsysLog.getLimit());
        List<LoginSysLog> sysLogsList = this.sysLogMapper.selectAllsysLogs();
        return new DataGridView(page.getTotal(),sysLogsList);
    }


}
